找传奇、传世资源到传世资源站!

WEBBROWER控件使用代理访问指定网页

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

使用Webbrower控件
WEBBROWER控件使用代理访问指定网页 C#语言基础-第1张 private void btnStart_Click(object sender, EventArgs e) { try { CheckIsNull(txtUrl.Text.Trim(), "视频地址"); if (chkProxy.Checked) CheckIsNull(txtProxy.Text.Trim(), "代理服务器"); string urlPath = txtUrl.Text.Trim(); string proxyPath = txtProxy.Text.Trim(); string loneyUrl = string.Empty; List<string> urlList = null; List<string> proxyList = null; if (chkImport.Checked) urlList = GetListFromFile(urlPath); if (chkProxy.Checked) proxyList = GetListFromFile(proxyPath); //string url2 = "http://v.youku.com/v_show/id_XMTUzNDk1MDcwOA==.html?from=s1.8-1-1.2"; //string url1 = "http://v.youku.com/v_show/id_XMTUyNjI3Njg2OA==.html?from=s1.8-1-1.2"; this.cmbType.Enabled = false; this.btnStart.Enabled = false; this.btnStop.Enabled = true; this.labShow.Text = ""; this.labShow.Visible = true; stoped = false; int viewType = cmbType.SelectedIndex; if (!chkImport.Checked) { loneyUrl = txtUrl.Text.Trim(); } ThreadPool.QueueUserWorkItem(delegate(object obj) { //UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, useAge, useAge.Length, 0); while (!stoped) {Thread.Sleep(200);if (!chkImport.Checked){ ViewVido(loneyUrl, proxyList); Thread.Sleep((int)txtSleepTime.Value * 1000);}else{ switch (viewType) { case 0: IndexView(urlList, proxyList); break; default: RandomView(urlList, proxyList); Thread.Sleep((int)txtSleepTime.Value * 1000); break; }} } }); ThreadPool.QueueUserWorkItem(delegate(object obj) { while (!stoped) { Thread.Sleep(983); this.labShow.Invoke(new Action(() => { this.labShow.Text = string.Format("总计点击{0}个视频", count); })); } }); } catch (Exception ex) { MessageBox.Show(ex.Message); } }

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复